package cn.springmvc.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cn.springmvc.dao.BaseDAO;
import cn.springmvc.model.entity.AlbumBean;

@Repository
public class AlbumDAOImpl implements BaseDAO<AlbumBean> {
	@Autowired(required=true)
	private SqlSession sqlSession;
	
	public boolean insert(AlbumBean t) {
		return sqlSession.insert("insertAlbum", t) > 0;
	}

	public List<AlbumBean> select(AlbumBean t) {
		return sqlSession.selectList("selectAlbum",t);
	}

	public boolean delete(AlbumBean t) {
		return sqlSession.delete("deleteAlbum", t) > 0;
	}

	public boolean update(AlbumBean t) {
		return sqlSession.update("updateAlbum", t) > 0;
	}

	public AlbumBean selectOne(AlbumBean t) {
		return sqlSession.selectOne("selectOneAlbum", t);
	}

}
